/**
 * C_Settings 组件样式
 */

// Tab 样式
.settings-tabs {
  :deep(.n-tabs-nav) {
    padding: 0 4px;
  }
}

// 章节样式
.settings-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--app-border-light);

  &:last-child {
    border-bottom: none;
  }
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--app-text-primary);
}

.section-description {
  font-size: 12px;
  color: var(--app-text-secondary);
  margin-bottom: 12px;
}

// 预设方案网格
.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 12px;
}

.preset-card {
  position: relative;
  padding: 18px 14px;
  border-radius: 12px;
  border: 2px solid var(--app-border-light);
  background: var(--app-bg-content);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  overflow: hidden;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(
      90deg,
      var(--app-primary),
      var(--app-primary-hover)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 3px 3px 0 0;
  }

  &:hover {
    border-color: var(--app-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(32, 128, 240, 0.12);

    &::before {
      opacity: 1;
    }

    .preset-icon {
      transform: scale(1.1);
    }

    .preset-name {
      color: var(--app-primary);
    }
  }

  &.active {
    border-color: var(--app-primary);
    background: linear-gradient(
      135deg,
      rgba(32, 128, 240, 0.08) 0%,
      rgba(32, 128, 240, 0.04) 100%
    );
    box-shadow: 0 8px 20px rgba(32, 128, 240, 0.2);

    &::before {
      opacity: 1;
    }

    .preset-name {
      color: var(--app-primary);
      font-weight: 600;
    }
  }
}

.preset-icon {
  font-size: 36px;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.preset-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--app-text-primary);
  transition: all 0.3s ease;
}

.preset-color {
  display: flex;
  justify-content: center;
}

.color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;

  &:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }
}

// 主题模式
.mode-group {
  width: 100%;

  :deep(.n-radio-button) {
    flex: 1;
  }
}

// 颜色选择器
.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.color-value {
  width: 80px;
  font-size: 13px;
  font-family: 'Courier New', monospace;
  color: var(--app-text-secondary);
}

// 圆角/动画选择
.radius-group,
.transition-group {
  width: 100%;

  :deep(.n-radio-button) {
    flex: 1;
  }
}

// 布局模式 - 优化网格设计
.layout-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.layout-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 12px;
  border-radius: 12px;
  border: 2px solid var(--app-border-light);
  background: var(--app-bg-content);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(
      90deg,
      var(--app-primary),
      var(--app-primary-hover)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 3px 3px 0 0;
  }

  &:hover:not(.disabled) {
    border-color: var(--app-primary);
    box-shadow: 0 8px 16px rgba(32, 128, 240, 0.12);
    transform: translateY(-4px);

    &::before {
      opacity: 1;
    }

    .layout-svg {
      transform: scale(1.05);
      color: var(--app-primary-hover);
    }

    .layout-label {
      color: var(--app-primary);
    }
  }

  &.active {
    border-color: var(--app-primary);
    background: linear-gradient(
      135deg,
      rgba(32, 128, 240, 0.08) 0%,
      rgba(32, 128, 240, 0.04) 100%
    );
    box-shadow: 0 8px 20px rgba(32, 128, 240, 0.2);

    &::before {
      opacity: 1;
    }

    .layout-label {
      color: var(--app-primary);
      font-weight: 600;
    }

    .layout-svg {
      color: var(--app-primary);
    }
  }

  &.disabled {
    cursor: not-allowed;
    opacity: 0.5;
    filter: grayscale(0.8);

    &:hover {
      transform: none;
      box-shadow: none;
      border-color: var(--app-border-light);

      &::before {
        opacity: 0;
      }
    }

    .layout-svg {
      color: var(--app-text-disabled);
    }

    .layout-label {
      color: var(--app-text-disabled);
    }
  }
}

.layout-screenshot {
  width: 100%;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--app-bg-surface);
  border-radius: 8px;
  padding: 8px;
  transition: all 0.3s ease;
}

.layout-svg {
  width: 64px;
  height: 48px;
  color: var(--app-text-secondary);
  transition: all 0.3s ease;
}

.layout-label {
  font-size: 13px;
  color: var(--app-text-primary);
  font-weight: 500;
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}

.badge-soon {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: linear-gradient(135deg, #faad14 0%, #fa8c16 100%);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(250, 173, 20, 0.3);
}

// 设置项
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 13px;
  color: var(--app-text-primary);
}

// 滑块
.slider-item {
  margin-bottom: 20px;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--app-text-primary);
}

.slider-value {
  font-weight: 600;
  color: var(--primary-color);
}

// 操作按钮
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

// 快捷键
.hotkey-list {
  margin-top: 12px;
}

.hotkey-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 12px;
  color: var(--app-text-secondary);
}

.hotkey-desc {
  color: var(--app-text-primary);
}

// 关于信息
.about-info {
  margin-top: 12px;
}

.about-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 12px;
  color: var(--app-text-secondary);
}

.about-value {
  font-weight: 600;
  color: var(--app-text-primary);
}
